<!--
 * @Author: canlong.shen
 * @Date: 2021-11-02 10:21:43
 * @LastEditors: your name
 * @LastEditTime: 2021-11-02 15:12:51
 * @Description: file content
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>列表渲染</title></title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <script src="https://unpkg.com/vue@next"></script>
  </head>
  <body>
    <div id="root"></div>
    <script>
      const app =   Vue.createApp({
        data() {
          return {
            list:[
              {name:"狗娃1",value:"gouwa1"},
              {name:"狗娃2",value:"gouwa2"},
              {name:"狗娃3",value:"gouwa3"},
              {name:"狗娃4",value:"gouwa4"},
              {name:"狗娃5",value:"gouwa5"},
              {name:"狗娃6",value:"gouwa6"},
              {name:"狗娃7",value:"gouwa7"},
           ],
           propsObj:{
              name:"狗剩",
              age:"18",
              gender:"男",
           }
          }
        },
        template: `
          <div>
            <span>数组</span>
           <ul>
               <li v-for="item of list ">{{item.name}}</li>
           </ul>
            <span>对象</span>
           <ul>
               <li v-for="(value,name,index) of propsObj "> {{name}} :{{value}} - {{index}}</li>
           </ul>
          </div>`,
      }) 
      
      const vm  =  app.mount("#root")
    </script>
  </body>
</html>
